﻿#if !WINDOWS_UWP && !NETFX_CORE
#region File and License Information
/*
<File>
	<License>
		Copyright © 2009 - 2017, Daniel Vaughan. All rights reserved.
		This file is part of Calcium (http://calciumsdk.net), 
		which is released under the MIT License.
		See file /Documentation/License.txt for details.
	</License>
	<CreationDate>2013-04-18 13:44:23Z</CreationDate>
</File>
*/
#endregion

using System;
using System.Device.Location;

using Windows.Devices.Geolocation;

namespace Outcoder.GeoLocation
{
	static class GeocoordinateExtensions
	{
		/* This class now exists in the Windows Phone Toolkit */
		public static GeoCoordinate ToGeoCoordinate(this Geocoordinate geocoordinate)
		{
			return new GeoCoordinate
				(
					geocoordinate.Latitude,
					geocoordinate.Longitude,
					geocoordinate.Altitude ?? Double.NaN,
					geocoordinate.Accuracy,
					geocoordinate.AltitudeAccuracy ?? Double.NaN,
					geocoordinate.Speed ?? Double.NaN,
					geocoordinate.Heading ?? Double.NaN);
		}
	}
}
#endif